package com.hcc.gateway.domain.vo;

import com.hcc.gateway.domain.base.BaseVo;
import com.hcc.gateway.domain.enums.ApiStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * api_config
 *
 * @author shengjun.hu
 * @date 2021/12/29
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ApiConfigVo extends BaseVo {

    private String apiName;
    private String apiDesc;
    private String path;
    private String targetUrl;
    private String protocol;
    private String paramTypeConfig;
    private Integer retryCount;
    private String httpMethod;
    private Integer limit;
    private String status;
    private String statusDesc;

    public String getStatusDesc() {
        ApiStatusEnum apiStatusEnum = ApiStatusEnum.getByName(status);
        return apiStatusEnum != null ? apiStatusEnum.getDesc() : null;
    }

}
